package command;

/**
 * User: Alexander Martyushov
 * Date: 12/11/12
 * Time: 7:10 AM
 */
public class RemoteLoader {

    public static void main (String[] args){
        RealRemoteControl realRemoteControl = new RealRemoteControl();

        Light livingRoomLight = new Light();
        Light kitchenLight = new Light();
        GarageDoor garageDoor = new GarageDoor();
        Stereo stereo = new Stereo();

        LightOnCommand livingRoomLightOn = new LightOnCommand(livingRoomLight);
        LightOffCommand livingRoomLightOff = new LightOffCommand(livingRoomLight);
        LightOnCommand kitchenLightOn = new LightOnCommand(kitchenLight);
        LightOffCommand kitchenLightOff = new LightOffCommand(kitchenLight);

        GarageDoorOpenCommand garageDoorOpen = new GarageDoorOpenCommand(garageDoor);

        StereoOnWithCDCommand stereoOnWithCD = new StereoOnWithCDCommand(stereo);

        realRemoteControl.setCommand(0, livingRoomLightOn, livingRoomLightOff);
        realRemoteControl.setCommand(1, kitchenLightOn, kitchenLightOff);
        realRemoteControl.setCommand(2, garageDoorOpen, stereoOnWithCD);

        System.out.println(realRemoteControl);

        realRemoteControl.onButtonWasPushed(0);
        realRemoteControl.offButtonWasPushed(0);
        realRemoteControl.undButtonWasPressed();
        realRemoteControl.onButtonWasPushed(1);
        realRemoteControl.offButtonWasPushed(1);
        realRemoteControl.onButtonWasPushed(2);
        realRemoteControl.offButtonWasPushed(2);

    }
}
